package com.ruoyi.project.mahjong.domain.uyil;

import com.ruoyi.common.utils.http.HttpUtilsBody;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class DeskUtils {

    public static String  clientType="svr";

    public static String  appKey="JYAK333464148377600";

    public static String  AppSecret="JYSECd00vPhRb1";

    public static String  AppSecretKey="JYSECd00vPhRb1";

    public static  String creatUrl="https://oauthapi.iot02.com/api/v1/user/login-app";


    public static String stateUrl="https://openapi.iot02.com/api/v1/equip-read/all-equip-state";


    public static String openUrl="https://openapi.iot02.com/api/v1/equip-opr/equip-open";

    public static String closeUrl="https://openapi.iot02.com/api/v1/equip-opr/equip-close";


    public static void main(String[] args) {
      String result=  HttpUtilsBody.getToken(creatUrl,null);
        System.out.println(result);
        try {
            HttpUtilsBody.getHttpUrl(stateUrl,result);
            Map params = new HashMap(1 << 1);//用于存放request body
            params.put("unid","JY332321597eiBn5");
            params.put("io",1);

        HttpUtilsBody.postHttpUrl(openUrl,result,params);
            //  HttpUtilsBody.postHttpUrl(closeUrl,result,params);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
